package cn.elwy.rcp.ui.explorer.core;

import cn.elwy.common.config.Config;
import cn.elwy.common.util.PathUtil;
import cn.elwy.osgi.config.ConfigContext;

public class PathConst {

	private static final String CONF_DIR = "conf/";

	public static final String PROJECT_TEMPLATE_FILE = CONF_DIR + "project_template.xml";
	public static final String MODULE_TEMPLATE_FILE = CONF_DIR + "module_template.xml";
	public static final String LAST_PROJECT_FILE = CONF_DIR + "last_project.xml";

	public static final String TARGET = "target";
	// public static final String WAR_NAME;
	public static final String DEFAULT_OUT_DIR;
	public static final String[] IGNORE_COPY_JAR;
	public static final String[] IGNORE_BUILDER_DIR;
	public static final String BUILDER_COMMAND;

	public static final String SOURCE_LIB_ROOT_PATH;
	public static final String SOURCE_SQL_ROOT_PATH;

	// 输出数据库脚本目录
	public static final String OUTPUT_SQL_DIR;
	public static final String[] SOURCE_SQL_PATHS;

	// 输出演示代码目录
	public static final String OUTPUT_DEMO_DIR;
	public static final String[] OUTPUT_SRC_DIR;
	// 输出文档目录
	public static final String OUTPUT_DOC_DIR;
	// public static final String OUTPUT_DOC_HELP_DIR;
	// public static final String OUTPUT_DOC_TEST_DIR;
	// public static final String OUTPUT_DOC_CHANGELOG_DIR;
	// 输出二进制文件目录
	public static final String OUTPUT_EXE_DIR;
	public static final String OUTPUT_EXE_UPDATE_DIR;
	// 输出二进制文件目录
	public static final String OUTPUT_TOOLS_DIR;
	public static final String OUTPUT_TOOLS_DOC_DIR;
	public static final String OUTPUT_TOOLS_PLUGINS_DIR;
	public static final String OUTPUT_TOOLS_EXE_DIR;

	static {
		Config config = ConfigContext.getConfig();

		// WAR_NAME = config.get(ConfConst.WAR_NAME);
		IGNORE_COPY_JAR = config.getArray(ConfConst.IGNORE_COPY_JAR);
		IGNORE_BUILDER_DIR = config.getArray(ConfConst.IGNORE_BUILDER_DIR);
		BUILDER_COMMAND = config.get(ConfConst.BUILDER_COMMAND);
		SOURCE_LIB_ROOT_PATH = config.get(ConfConst.SOURCE_LIB_ROOT_PATH);
		SOURCE_SQL_ROOT_PATH = config.get(ConfConst.SOURCE_SQL_ROOT_PATH);
		DEFAULT_OUT_DIR = config.get(ConfConst.DEFAULT_OUT_DIR);

		OUTPUT_SQL_DIR = config.get(ConfConst.OUTPUT_SQL_DIR);
		SOURCE_SQL_PATHS = config.getArray(ConfConst.SOURCE_SQL_PATHS);

		OUTPUT_DEMO_DIR = config.get(ConfConst.OUTPUT_DEMO_DIR);
		OUTPUT_SRC_DIR = config.getArray(ConfConst.OUTPUT_SRC_DIR);

		OUTPUT_DOC_DIR = config.get(ConfConst.OUTPUT_DOC_DIR);
		// OUTPUT_DOC_HELP_DIR = PathUtil.getFilePath(OUTPUT_DOC_DIR, config.get(ConfConst.OUTPUT_DOC_HELP_DIR));
		// OUTPUT_DOC_TEST_DIR = PathUtil.getFilePath(OUTPUT_DOC_DIR, config.get(ConfConst.OUTPUT_DOC_TEST_DIR));
		// OUTPUT_DOC_CHANGELOG_DIR = PathUtil.getFilePath(OUTPUT_DOC_DIR, config.get(ConfConst.OUTPUT_DOC_CHANGELOG_DIR));

		OUTPUT_EXE_DIR = config.get(ConfConst.OUTPUT_EXE_DIR);
		OUTPUT_EXE_UPDATE_DIR = config.get(ConfConst.OUTPUT_EXE_UPDATE_DIR);

		OUTPUT_TOOLS_DIR = config.get(ConfConst.OUTPUT_TOOLS_DIR);
		OUTPUT_TOOLS_DOC_DIR = PathUtil.getFilePath(OUTPUT_TOOLS_DIR, config.get(ConfConst.OUTPUT_TOOLS_DOC_DIR));
		OUTPUT_TOOLS_PLUGINS_DIR = PathUtil.getFilePath(OUTPUT_TOOLS_DIR, config.get(ConfConst.OUTPUT_TOOLS_PLUGINS_DIR));
		OUTPUT_TOOLS_EXE_DIR = PathUtil.getFilePath(OUTPUT_TOOLS_DIR, config.get(ConfConst.OUTPUT_TOOLS_EXE_DIR));
	}

}
